package math;

import java.util.ArrayList;
import java.util.List;

public class List100 {
	public static void main(String[] args) {
		List<Integer> list = new ArrayList<>(100);
		for(int i=1;i<=100;i++){
			list.add(i);
		}
		int count = 0;
		while(list.size()>1){
			count++;
			int tmp = list.get(0);
			if(count!=3){
				list.remove(0);
				list.add(tmp);
				continue;
			}
			list.remove(0);
			count = 0;
		}
		System.out.println(list.get(0));
	}
}
